package com.asa.spring.ioc;

import com.asa.spring.ioc.entity.Person;
import com.asa.spring.ioc.entity.Student;
import com.asa.spring.ioc.main.BeanFactory;
import com.asa.spring.ioc.main.ClassPathXmlApplicationContext;

public class TestBean {

	public static void main(String[] args) {
		
		BeanFactory bf=new ClassPathXmlApplicationContext("/applicationContext.xml");
        Person s=(Person)bf.getBean("person");
        Person s1=(Person)bf.getBean("person");
        System.out.println(s==s1);
        System.out.println(s1);
        Student stu1=(Student) bf.getBean("student");
        Student stu2=(Student) bf.getBean("student");
        String name=stu1.getName();
        System.out.println(name);
        System.out.println(stu1==stu2);

		    


		

		
	}
	
	
}
